package com.google.gson;

import java.util.*;

public class Main {

    //1、public <T> T fromJson(JsonReader reader, Type typeOfT) throws JsonIOException, JsonSyntaxException
    public static void main(String[] args) {
        Gson gson = new Gson();
//        String jsonString0 = "true";
//        Boolean value1 = gson.fromJson(jsonString0, Boolean.class);

//        String jsonString1 = "{\"name\": \"lzs\"}";
//        Map map = gson.fromJson(jsonString1, Map.class);

        String jsonString2 = "[11,12]";
        LinkedList linkedList = gson.fromJson(jsonString2, LinkedList.class);
        //System.out.println(linkedList);


//        String jsonString7 = "{\"id\":2 , \"name\": \"lzs\", phone:[13377227522, 133886439821]}";
//        User user = gson.fromJson(jsonString7, User.class);
//        //System.out.println(user);

//        Map map2 = new HashMap();
//        List list = new ArrayList();
//        list.add(1);
//        list.add(2);
//        map2.put(list, true);
//        String json = gson.toJson(map2);
//        //System.out.println(json);

//        //System.out.println(map);
//        String jsonString5 = "[12,11]";
//        String jsonString2 = "{\"name\": [12,11]}";
//        String jsonString4 = "{\"name\": [{\"name\": \"lzs\"},{\"name\": \"lzs\"}]}";
    }

    static class User extends People {
        private int id;

        private String name;

        private List<String> phone;
    }

    static class People {
        private int idCard;
    }

}
